<?php

namespace app\controller\api;

use think\App;
use app\BaseController;

class ApiBaseController extends BaseController
{

    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    public function success($d_msg = 'success', $d_data = [], $d_code = 200, $code = 200, $header = [], $options = [])
    {
        return api_response($d_code, $d_msg, $d_data, $code, $header, $options);
    }

    public function error($d_msg = 'error', $d_data = [], $d_code = -1, $code = 200, $header = [], $options = [])
    {
        return api_response($d_code, $d_msg, $d_data, $code, $header, $options);
    }
}
